<template>
  <view class="catitemsBox">
    <view class="catitems" v-for="item in list" :key="item.name">
      <img :src="item.image_src" />
    </view>
  </view>
</template>

<script>
import { getCatitemsAPI } from "@/api/index";
export default {
  data() {
    return {
      list: [],
    };
  },
  created() {
    this.getCatitems();
  },
  methods: {
    async getCatitems() {
      const { message } = await getCatitemsAPI();
      this.list = message;
    },
  },
};
</script>

<style lang="scss">
.catitemsBox {
  display: flex;
  justify-content:space-around;
  width: 750rpx;
  margin-top: 68rpx;
  img {
    width: 128rpx;
    height: 140rpx;
  }
}
</style>
